<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:fbi="http://www.fbifaces.org"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .input-col-m {
                width: 60px;
            }

            .input-col-l {
                width: 80px;
            }

            .input-col-xxl {
                width: 1%;
                text-align: right;
            }

            .col-95 {
                text-align: right;
            }

            .col-5 {
                text-align: left;
            }
        </style>
        <script type="text/javascript" src="#{request.contextPath}/UI/support/dialogwindow.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                }
            }
        </script>

    </ui:define>

    <ui:define name="content">
        <div style="margin:5px;" id="top">
            <h:form id="qryForm">
                <p:growl life="2000" id="msgs" showDetail="false"/>
                <p:panel id="query" header="监管账号交易明细">
                    <h:panelGrid columns="2" cellspacing="3" style="width:100%">
                        <h:panelGrid columns="4" cellspacing="3" style="width:80%"
                                     columnClasses="col-95,col-5,col-95,col-5">
                            <h:outputLabel value="账户名称："/>
                            <h:inputText value="#{accountTradeDetlAction.acctname}" style="width:146px;"/>
                            <h:outputLabel value="*账户号："/>
                            <h:inputText value="#{accountTradeDetlAction.acctno}" required="true"
                                         requiredMessage="账号不能为空！"
                                         style="width:146px;"/>
                            <h:outputLabel value="起始日期："/>
                            <p:inputText
                                         onclick="WdatePicker({dateFmt:'yyyyMMdd'})"
                                         value="#{accountTradeDetlAction.strStartDate}"/>
                            <h:outputLabel value="截止日期："/>
                            <p:inputText
                                         onclick="WdatePicker({dateFmt:'yyyyMMdd'})"
                                         value="#{accountTradeDetlAction.strEndDate}"/>
                        </h:panelGrid>
                        <h:panelGrid style="width:20%">
                            <p:commandButton style="margin-left:15px;width:90px" ajax="true"
                                             action="#{accountTradeDetlAction.onQueryCbs}" id="btnQuery"
                                             value="查询" update="msgs,pdt">
                            </p:commandButton>
                            <!--<p:commandButton ajax="false" id="resetBtn" value="Excel导出"
                                             style="width:90px;margin-left:15px">
                                <fbi:DataExporter titleName="监管账户交易明细" target="pdt" type="xls"
                                                  fileName="account_Trade_Detl"
                                                  excludeColumnsWidth="14,14,15,15,15,10,10,12,12,10,15,14,10,12,10"/>
                            </p:commandButton>-->
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:dataTable id="pdt" dynamic="true" selectionMode="single"
                             value="#{accountTradeDetlAction.cbsAccTxnList}" var="record"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true" rows="15" paginatorPosition="bottom"
                             rowsPerPageTemplate="100,50,30,15,5"
                             emptyMessage="数据记录为空...">

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="监管账号"/>
                        </f:facet>
                        <h:outputText value="#{record.accountNo}"></h:outputText>
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="账户名"/>
                        </f:facet>
                        <h:outputText value="#{record.accountName}"/>
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="交易流水号"/>
                        </f:facet>
                        <h:outputText style="float:right;" value="#{record.txnSerialNo}"/>
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="借方发生额"/>
                        </f:facet>
                        <h:outputText style="float:right;" value="#{record.debitAmt}">
                            <f:convertNumber pattern="###,##0.00"/>
                        </h:outputText>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="贷方发生额"/>
                        </f:facet>
                        <h:outputText style="float:right;" value="#{record.creditAmt}">
                            <f:convertNumber pattern="###,##0.00"/>
                        </h:outputText>
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="交易日期"/>
                        </f:facet>
                        <h:outputText value="#{record.txnDate}"/>
                    </p:column>
                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="交易时间"/>
                        </f:facet>
                        <h:outputText value="#{record.txnTime}"/>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>